Lazy Test ^^^^^ **Definition:** * More than one test case with the same fixture that tests the same method. This smell affects test maintainability, as assertions testing the same method should be in the same test case. Like EAGER TEST, the original definition [3] leaves some details to interpretation. We consider every call to the class under test as a potential cause of LAZY TEST, irrespective of whether their results are used in an assertion. **Code Example:** .. code-block:: java @Test public void testDecrypt() throws Exception { FileInputStream file = new FileInputStream(ENCRYPTED_DATA_FILE_4_14); byte[] enfileData = new byte[file.available()]; FileInputStream input = new FileInputStream(DECRYPTED_DATA_FILE_4_14); byte[] fileData = new byte[input.available()]; input.read(fileData); input.close(); file.read(enfileData); file.close(); String expectedResult = new String(fileData, "UTF-8"); assertEquals("Testing simple decrypt",expectedResult, Cryptographer.decrypt(enfileData, "test")); } @Test public void testEncrypt() throws Exception { String xml = readFileAsString(DECRYPTED_DATA_FILE_4_14); byte[] encrypted = Cryptographer.encrypt(xml, "test"); String decrypt = Cryptographer.decrypt(encrypted, "test"); assertEquals(xml, decrypt); } **References:** .. admonition:: Quality attributes * :octicon:`file-code;1em` - Code Example * :octicon:`comment-discussion;1em` - Cause and Effect * :octicon:`graph;1em` - Frequency * :octicon:`sync;1em` - Refactoring * `An Empirical Study into the Relationship Between Class Features and Test Smells `_ :octicon:`graph;1em` * `An Exploratory Study on the Refactoring of Unit Test Files in Android Applications `_ :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `An empirical analysis of the distribution of unit test smells and their impact on software maintenance `_ :octicon:`graph;1em` * `An exploratory study of the relationship between software test smells and fault-proneness `_ :octicon:`comment-discussion;1em` :octicon:`graph;1em` * `Are test smells really harmful? An empirical study `_ :octicon:`comment-discussion;1em` :octicon:`graph;1em` :octicon:`sync;1em` * `Assessing diffusion and perception of test smells in scala projects `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`graph;1em` :octicon:`sync;1em` * `Automatic Identification of High-Impact Bug Report by Product and Test Code Quality `_ * `Automatic generation of smell-free unit tests `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` * `Categorising Test Smells `_ :octicon:`graph;1em` * `Developers perception on the severity of test smells: an empirical study `_ :octicon:`graph;1em` :octicon:`sync;1em` * `Enhancing developers’ awareness on test suites’ quality with test smell summaries `_ * `Handling Test Smells in Python: Results from a Mixed-Method Study `_ * `Investigating Test Smells in JavaScript Test Code `_ :octicon:`graph;1em` * `On the diffusion of test smells and their relationship with test code quality of Java projects `_ :octicon:`graph;1em` * `On the distribution of test smells in open source Android applications: an exploratory study `_ :octicon:`graph;1em` * `On the influence of Test Smells on Test Coverage `_ * `On the interplay between software testing and evolution and its effect on program comprehension `_ :octicon:`comment-discussion;1em` * `On the test smells detection: an empirical study on the jnose test accuracy `_ :octicon:`graph;1em` * `On the use of test smells for prediction of flaky tests `_ :octicon:`comment-discussion;1em` :octicon:`graph;1em` * `Refactoring Test Code `_ :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `Refactoring Test Smells With JUnit 5: Why Should Developers Keep Up-to-Date? `_ * `SoCRATES: Scala radar for test smells `_ * `Software Unit Test Smells `_ :octicon:`file-code;1em` * `Test Smell Detection Tools: A Systematic Mapping Study `_ * `The secret life of test smells-an empirical study on test smell evolution and maintenance `_ :octicon:`graph;1em` * `What the Smell? An Empirical Investigation on the Distribution and Severity of Test Smells in Open Source Android Applications `_ :octicon:`graph;1em` * `tsDetect: an open source test smells detection tool `_